/**
 * @param {number} bottom
 * @param {number} top
 * @param {number[]} special
 * @return {number}
 */
 var maxConsecutive = function(bottom, top, special) {
  special.sort((a, b) => a - b);
  let ret = 0;
  special.reduce((a, b) => { 
      ret = Math.max(ret, b - a -1); 
      return b;
  });
  return Math.max(ret, special[0] - bottom, top - special[special.length - 1]);
};